package net
{
	import flash3.net.ByteArrayPlus;
	import flash3.net.MsgPacket;
	
	import net.MessageDef;
	
	public class LobbyLoginGroup extends MessageGroup
	{
		public static const MDM_GP_LOGON:uint					= 	1								//广场登录
		
		public static const SUB_GP_LOGON_ACCOUNTS:uint		=	1								//帐号登录
		public static const SUB_GP_LOGON_USERID:uint			=	2								//I D 登录
		public static const SUB_GP_REGISTER_ACCOUNTS:uint		=	3								//注册帐号
		
		public static const SUB_GP_LOGON_SUCCESS:uint			=	100								//登陆成功
		public static const SUB_GP_LOGON_ERROR:uint			=	101								//登陆失败
		public static const SUB_GP_LOGON_FINISH:uint			=	102								//登陆完成
		
		public function LobbyLoginGroup()
		{
			super();
		}
		
		override public function defMessage():void
		{
			addMessage(new MessageDef(MDM_GP_LOGON, SUB_GP_LOGON_ACCOUNTS, "账户登录", onLoginAccounts));
			addMessage(new MessageDef(MDM_GP_LOGON, SUB_GP_LOGON_USERID, "账户登录", onLoginUserID));
			addMessage(new MessageDef(MDM_GP_LOGON, SUB_GP_LOGON_SUCCESS, "账户登录", onLoginSuccess));
			addMessage(new MessageDef(MDM_GP_LOGON, SUB_GP_LOGON_ERROR, "账户登录", onLoginError));
			addMessage(new MessageDef(MDM_GP_LOGON, SUB_GP_LOGON_FINISH, "账户登录", onLoginFinish));
		}
		
		public function onLoginAccounts(packet:MsgPacket, data:Array):void
		{
			var bap:ByteArrayPlus = packet._data;
//			bap.writeString(data[0]);
//			bap.writeString(data[1]);
			bap.writeByte(1);
			bap.writeByte(1);
			bap.writeShort(19);
			bap.writeShort(20);
			
//			bap.writeInt(0);
//			bap.writeInt(0);
//			bap.writeInt(0);
//			bap.writeInt(0);
		}
		public function onLoginUserID(packet:MsgPacket, data:Array):void
		{
			
		}
		public function onLoginSuccess(packet:MsgPacket):void
		{
			
		}
		public function onLoginError(packet:MsgPacket):void
		{
			
		}
		public function onLoginFinish(packet:MsgPacket):void
		{
			
		}
	}
}